package com.gitee.shop.uitl;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016110200785806";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDcK/eV1R8AwQZwRrmF+NT296SHSn6RWLu1vGwgbV8PJ7jmnA1qiu6Bn/xikPEFMu+n9Ca4XAOHESYv2owPaJogh2EdQ5/m1CmBZ038SPtEYd6xjk1xQgNq4DQQRDGeKCTTu2GyhM2pKN/GSaiBFTg0kuLMGr3PC4itqjjMuz857GGi+5GEKJxKzSm0RtYODL/Hg5rSbRPDQ/L9vCgel3Ob6SJ1HgPKNdtDFz+TZsSmEXO9y/73CuZf8UJ18zkZK+2JpurDxf3msiea2AjxYtXOYdFOlgozEDBj/Gjyx9VJP9659NIvi00+08WHFDYruT0Of8dE1yiZrZu/9YslDBpDAgMBAAECggEABIZ20UKPH5HYEwixGXrSzbyrSgiS72PWf9a+ljAJSyNy3nKIqA7w9gMWyePWwFeaq2YOQa3KeMU2drdUN6Dbwh1mNpbEO5dSvxEjfjL1zyL/08BsAQ7tSQ4Qo+Dy8CA9GYj5ahTmsTpg1w9+giCwhgwa0z0dd5ryFTexcSvMEeGrIal/BZIWQdx5R/Tdr7tqXTGGVDhoAKAdoHm+OltmrBIWaz6OAT/7ZMW5ADg5V4L99vZT3/IP5Tc8L8uQjBj3XxyU2xUyd4Sd/AeCJjKykaRcNhJrxmSqmUIjO14z9ZS1KVmjfvgp3XH+A+sHfNnPjOcQg9b16lBANeT0yX4myQKBgQDugg1V3rqByY3lhs1Cs9/zbx+b4PsxJ8ZT0sndaHvw8WBUPe3znPRlN06CyE67HyGTur2DP62em9ga1tlJePp1CN+XHSOR21qVU/uV4aSkXDxT/PNp8xL9ZqT2tMSkm55QfkK05CZfqFIZt7ySEVxQDHb4tvcho5M7mcxbI4gFhQKBgQDsUaeX/68iTo3ruMFLBNKBWVyssvfUWPM3SXl5oppE/+nUO/GtxFl5tCXn8jOtl5ke7YZv4ZFigrIR8ybLY9ljM9EGjbpDngvVz/wnegLYoIhYLTcV7Www6dD8gQSl+zxOjga3gEscy47jIdEB0kbNtC+wKgHnK6qGgxCKk0wnJwKBgQCbceVxFsWlexBhDJdQpt0J0l3egSYVpl+rGBF6nPNSWG642Nfx01SxdvdTY2t0p1iB6M5E8UadveJ9s5NQQGmzx0G6QkKBeF40PtUUnUhp2rdy4cRfRA4XW0OeirgytD3dJj0hmiSsaY6AtnBPHsN0ZHtRpCWzJeH6kUVQDPtE5QKBgQC8k7hCMdVGchsMNGWCgLmeYHn0kefz+nsy7h3Sc2/ZicHFC4Si3mFsHdZ1za9xYdzdcjtqQjzquFJywm59tRL+95VgPm6ZkJ/vIcYcll95EDlc68/eXpSMP7j2FdpovR/1q54uhmDp/IHsO8r2Qh8f/R5k3FCicRTlu+bSPhJx1wKBgQCGH/ZORxqRrDwm0MJ2bmuqgxTjE0aMmaa7I9QUfCdUEfIl8DwoeT3vOdOSDAGzJRpJV8z1kP5P69fzrkFgjlGchuzQSVtmxT96zplqSt40yn2pUIJ0ucQoD3CkQL3zk6BJh+15PnkTjg58ERpGG6c0UgeIV315lkSXXMVOpLZg8A==";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjgkLN1Z6CI/34NqvHyPxM2bvRcTo+4BEFFI7Q5LKT/Wycq9uvggnPLyNy+HU8yEd2oTJxxsrEGolhZGmUCSKaMXz5FnhKNrGLbFZ+YAK9dCMpe3cYrlefIxc3HN0imCplCqrCO5If6ma5Onqe1AnnaFqFlEsK1L1gzahu+SWiFK/OuLVBSAg3uj0SoFyuYWIJGTWau58oTHZ6ECLyVGB+KFqVFtJNwfV2jC4VoVdESEudR8JJgBjjlqANFMyas/AJPph2yTNhseshHQAspMK7yYqj85UVp8SYURyTuIoi7iB/9H3IMPew1BFNnd3qdhlWfvf/nhKAJcJ8gsZsRVq6wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/pay/rollback";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


